Apple Event Handlers Supplied by Client Applications
This section describes the Apple events for which client applications must install handlers. Text service components request action from and send information to client applications through these Apple events.
Your application uses these Apple events to receive text from text service components, to show or hide input windows, and to convert screen positions to text offsets--and vice versa--for text service components. The conversion operations are used to track mouse events and determine screen locations of text in the active input area.
The Apple events described in this section are all organized under the kTextServiceClass
constant with a value of 'tsvc'
.
lists the Apple event ID constants for the Apple events described in this section.
Table 7-1 Apple event ID constants
Constant | Value | Explanation |
---|
kUpdateActiveInputArea | 'updt' | Update Active Input Area |
kPos2Offset | 'p2st' | Position To Offset |
kOffset2Pos | 'st2p' | Offset To Position |
kShowHideInputWindow | 'shiw' | Show/Hide Input Window |
Table 7-2 shows the Apple event keyword constants used in the Apple events described in this section.
Table 7-2 Apple event keyword constants (Continued)
Constant | Value | Meaning |
---|
keyAETSMDocumentRefcon | 'refc' | TSM document reference constant |
keyAEServerInstance | 'srvi' | Component instance |
keyAETheData | 'kdat' | Text from active input area |
keyAEScriptTag | 'sclg' | Script-language record |
keyAEFixLength | 'fixl' | Length of confirmed text |
keyAEHiliteRange | 'hrng' | Highlight range in text |
keyAEUpdateRange | 'udng' | Update range in text |
keyAEClauseOffsets | 'clau' | Clause offsets array |
keyAECurrentPoint | 'cpos' | Current point |
keyAEDragging | 'bool' | Dragging flag |
keyAEOffset | 'ofst' | Byte offset in text |
keyAERegionClass | 'rgnc' | Region class |
keyAEPoint | 'gpos' | Calculated point |
optional keyword for Update Active Input Area |
keyAEPinRange | 'pnrg' | Range for scrolling |
optional keywords for Offset To Position |
keyAETextFont | 'ktxf' | Text font |
keyAETextPointSize | 'ktps' | Text size |
keyAETextLineHeight | 'ktlh' | Text line height |
keyAETextLineAscent | 'ktas' | Font ascent |
keyAEAngle | 'kang' | Text angle |
optional keyword for Position To Offset |
keyAELeadingEdge | 'klef' | Leading-edge Boolean |
Table 7-3 lists the Apple event descriptor types discussed in this section.
Table 7-3 Apple event descriptor types
Constant | Value | Meaning |
typeComponentInstance | 'cmpi' | Server instance |
typeTextRangeArray | 'tray' | Text range array |
typeOffsetArray | 'ofay' | Offset array |
typeIntlWritingCode | 'intl' | Script-language record |
typeQDPoint | 'QDpt' | QuickDraw point |
typeAEText | 'tTXT' | Apple event text |
typeText | 'TEXT' | Plain text |
typeTextRange | 'txrn' | A text range record |
typeTSMDocumentRefcon | 'refc' | TSM document reference constant |
typeFixed | 'fixd' | Fixed 16.16 format |
Table 7-4 lists the Apple event descriptor type constants for region class discussed in
this section.
Table 7-4 Apple event descriptor type constants for the Apple event region class
Constant | Value |
---|
kTSMOutsideOfBody | 1 |
kTSMInsideOfBody | 2 |
kTSMInsideOfActiveInputArea | 3 |
For the values of standard Apple event constants used in the following section not listed in these tables, see the Apple Event Registry: Standard Suites.
Subtopics
- Creating and Updating an Active Input Area
-
- Converting Global Coordinates to Text Offsets
-
- Converting Text Offsets to Global Coordinates
-
- Showing or Hiding the Floating Input Window
-